<%@tag import="com.alibaba.fastjson.JSONObject"%>
<%@tag import="com.alibaba.fastjson.JSON"%>
<%@tag import="java.util.*"%>
<%@ tag pageEncoding="UTF-8"%>
<%@ attribute name="pageNum" required="true"  %>
<%@ attribute name="pageSize" required="false" %>
<%@ attribute name="pages" required="false" %>
<%@ attribute name="total" required="false" %>
<%@ attribute name="url" required="false" %>
<%@ attribute name="data" required="false" %>
<%
	int tt = Integer.valueOf(total);
	int pagenum = Integer.valueOf(pageNum);
	
		String pama = "";
	if(data!=null&&data.indexOf("{")!=-1&&data.indexOf("}")!=-1){
	
			JSONObject jdata = JSON.parseObject(data);
			Iterator<String> iterator = jdata.keySet().iterator();
			while(iterator.hasNext()){
				String key = iterator.next();
				String value = jdata.getString(key);
				if(value!=null&&value.trim().length()>0){
					pama = "&"+key+"="+value;
				}
			}
	
	}
	

%>
<div class="list-page ov">
	<ul class="page ov">
		<%
			if (pagenum == 1) {
		%>
		<li><a href="javascript:void(0);" class="prev disable">上一页</a></li>
		<%
			} else {
		%>
		<li><a href="<%=String.format(url, String.valueOf(pagenum - 1))+pama%>"
			class="prev">上一页</a></li>
		<%
			}
		%>
		<%
			for (int i = 9; i >= 0; i--) {
				int pn = tt - i;
				if (tt - i > 0) {
					if (pagenum == pn) {
		%>
		<li><a href="<%=String.format(url, String.valueOf(tt - i))+pama%>"
			class="now"><%=tt - i%></a></li>
		<%
			} else {
		%>
		<li><a href="<%=String.format(url, String.valueOf(tt - i))+pama%>"><%=tt - i%></a></li>
		<%
			}
				}
			}
		%>
		<%if(tt>pagenum){ %>

		<li><a href="<%=String.format(url, String.valueOf(pagenum + 1))+pama%>" class="next">下一页</a></li>
		<%}else{%>
			<li><a href="javascript:void(0);" class="next disable">下一页</a></li>
		<%} %>
	</ul>
</div>
